package com.blb.permission_ms.controller;

import com.blb.permission_ms.entity.ResponseResult;
import com.blb.permission_ms.entity.Role;
import com.blb.permission_ms.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RoleController {

    @Autowired
    private RoleService roleService;

    @RequestMapping("/roles")
    public ResponseResult<List<Role>> getAllRoles(){
        List<Role> roles = roleService.list();
        return ResponseResult.ok(roles);
    }
}
